package edu.whu.webgis.entity;

import edu.whu.webgis.utils.ImgUtil;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class VUser {
    String id;
    String name;
    String nickname;
    String avatar;
    String background;
    String signature;
    String major;
    String clazz;
    String wechat;
    String phone;
    String QQ;
    String motto;
    Integer courses;
    Double credits;
    Integer cities;
    public VUser(User user){
        this.setId(user.getId());
        this.setName(user.getName());
        this.setNickname(user.getNickname());
        this.setAvatar(ImgUtil.getBase64Jpg(user.getAvatar()));
        this.setBackground(ImgUtil.getBase64Jpg(user.getBackground()));
        this.setSignature(user.getSignature());
        this.setMajor(user.getMajor());
        this.setClazz(user.getClazz());
        this.setWechat(user.getWechat());
        this.setPhone(user.getPhone());
        this.setQQ(user.getQQ());
        this.setMotto(user.getMotto());
        this.setCourses(user.getCourses());
        this.setCredits(user.getCredits());
        this.setCities(user.getCities());
    }
}
